{extend name="public/common"}

{block name="style"}
<title>个人中心</title>
<link rel="stylesheet" href="/home/css/user/index.css?v={$Think.config.version}">
{/block}

{block name="body"}
<div id="app" v-cloak>
    <div class="head">
        <div class="img-box">
            <img :src="detail.header?detail.header:'/home/images/common/default.png'" />
        </div>
        <div class="content">
            <p>{{detail.name}}</p>
            <p>{{detail.department_name}}</p>
        </div>
    </div>
    <div class="list">
        <a href="/home/user/info.html">
            <div>
                <img src="/home/images/user/user-1.png" />
                <p>个人信息</p>
                <i class="fa fa-angle-right"></i>
            </div>
        </a>
        <a href="/home/approval/index.html" @click="addSessionStorage(2)">
            <div>
                <img src="/home/images/user/user-2.png" />
                <p>我的申请</p>
                <i class="fa fa-angle-right"></i>
            </div>
        </a>
        <a href="/home/approval/index.html" @click="addSessionStorage(3)" v-if="detail.is_permission < 3">
            <div>
                <img src="/home/images/user/user-3.png" />
                <p>我的审批</p>
                <i class="fa fa-angle-right"></i>
            </div>
        </a>
    </div>
</div>
{/block}

{block name="script"}
<script>
    console.log({$user})
    var vw = new Vue({
        el: "#app",
        data: {
            detail:{$user}
        },
        methods: {
            addSessionStorage(key) {
                window.sessionStorage.setItem('approval_type',key);
            }
        }
    })
</script>
{/block}
